<?php
class FollowUser extends AppModel{
	var $belongsTo = array('User'=>array('className'=>'User',
										 'foreignKey'=>'user_id'),
						   'User_Followed'=>array('className'=>'User',
										 'foreignKey'=>'user_id_followed'));
	
	function getListFl($uid){
		$this->unbindModel(array('belongsTo'=>array('User')),false);
		$listUser = $this->find('all',array('conditions'=>array('user_id_followed'=>$uid)));
		if($listUser){
			foreach ($listUser as $user){
				$u[]=$user['FollowUser']['user_id'];
			}
			return $u;
		}
		return false;
	}
	
	function get_list_auto($u_id){
		$this->unbindModel(array('belongsTo'=>array('User')),false);
		$listUser = $this->find('all',array('conditions'=>array('user_id'=>$u_id)));
	}
}